package com.example.shushiyunsst.fragment.main.home.child.new_sale.recycler.provider

import android.content.Context
import android.view.View
import com.example.library_common.adapter.multi.JssMultiItemViewHolder
import com.example.shushiyunsst.R
import com.example.shushiyunsst.fragment.main.home.child.new_sale.recycler.bean.NewSaleMineWrapperEntity
import com.example.shushiyunsst.fragment.main.home.child.new_sale.recycler.bean.NewSaleNotifyEntity
import com.example.shushiyunsst.fragment.main.home.child.new_sale.recycler.bean.NewSaleNotifyWrapperEntity
import com.example.shushiyunsst.widget.NewsFlipperView

class NewSaleNotifyProvider (view: View?)
    : JssMultiItemViewHolder<NewSaleNotifyWrapperEntity>(view){

    private var mNewsFlipperView: NewsFlipperView? = null

    override fun getItemLayout(): Int {
        return R.layout.new_sale_notify_provider
    }

    override fun convert(context: Context?, m: NewSaleNotifyWrapperEntity?) {
        super.convert(context, m)
        mNewsFlipperView = findView22(R.id.mNewsFlipperView)
        val mls = mutableListOf<String>()

        val list = m?.getData()?: emptyList()

        for (item in list) {
            mls.add((item as NewSaleNotifyEntity).contentDesc)
        }
        mNewsFlipperView?.setData(mls)
    }
}